﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;

namespace MyPlayer.Converters
{
    [ValueConversion(typeof(WindowState), typeof(Visibility))]
    public class WindowStateConverter : IValueConverter
    {
        static WindowStateConverter()
        {
            Instance = new WindowStateConverter();
        }

        public static WindowStateConverter Instance
        {
            get;
            private set;
        }

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is WindowState.Maximized)
            {
                return Visibility.Visible;
            }
            else
            {
                return Visibility.Hidden;
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
